package main

import (
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
	_ "github.com/mattn/go-sqlite3"
	"github.com/prometheus/common/promlog"
	"http_monitor/handle"
	_ "http_monitor/routers"
)

func init() {
	orm.RegisterDriver("sqlite", orm.DRSqlite)
	orm.RegisterDataBase("default", "sqlite3", "./db/monitor.db")
	orm.RunSyncdb("default", false, true)
}

func main() {
	//beego.Handler()
	promlogConfig := &promlog.Config{}
	logger := promlog.New(promlogConfig)
	beego.Handler("/metrics", handle.NewHandler(false, 20, logger))

	beego.Run()
}
